#include <iostream>
#include <unistd.h>
#include <pthread.h>

using namespace std;

void* callback1(void* args)
{
    int i = 0;
    while (true)
    {
        cin >> i; 
        cout << "callback1: " << pthread_self() << endl;
        sleep(1);
    }
}

void* callback2(void* args)
{
    while (true)
    {
        cout << "callback2: " << pthread_self() << endl;
        sleep(1);
    }
}

int main()
{
    pthread_t t1, t2;
    pthread_create(&t1, nullptr, callback1, nullptr);
    pthread_create(&t2, nullptr, callback2, nullptr);

    while (true){}

    pthread_join(t1, nullptr);
    pthread_join(t2, nullptr);
}